import Vue from 'vue'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import './assets/less/index.less';
import './plugins/axios'
import App from './App.vue'
import i18n from './i18n';
import router from './router'
import './common/vue-filter/index'
import './assets/font/iconfont.css'
import store from './store';
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer';
import VueClipboard from 'vue-clipboard2';
import { getViewUiLanguageName } from "@/config/locale-language-mapping-config";
// 创建事件总线
const eventBus = new Vue();

import VueCookies from 'vue-cookies'
Vue.use(VueCookies, { expires: '30d' })

// 完整加载
import VueLuckyCanvas from '@lucky-canvas/vue'
Vue.use(VueLuckyCanvas)

import webToast from "@/common/web-Toast";
Vue.use(webToast);

import VueGtag from "vue-gtag"; // google gta 统计
Vue.use(VueClipboard);
Vue.use(VueViewer);
let userViewLocale = getViewUiLanguageName();
Vue.use(ViewUI, { locale: userViewLocale.default });

Vue.config.productionTip = false;
Vue.use(VueGtag, {
  config: {
    id: "G-TXVJ6KGRSX",
    enabled: process.env.ENV == "production"
  }
}, router);

ViewUI.Message.config({
  top: 46,
  duration: 3
});
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
// 将事件总线暴露出去，以便在其他地方使用
export { eventBus };
